import { createRouter, createWebHistory } from 'vue-router'
export const Layout = () => import("@/layout/index.vue");

export const routes: any = [
  {
    path: "/createTask",
    name: "createTask",
    component: () => import("@/views/createTask/index.vue"),
    meta: { title: '创建任务' }
  },
  {
    path: "/taskSituation",
    name: "taskSituation",
    component: () => import("@/views/taskSituation/index.vue"),
    meta: { title: '任务情况' }
  },
  {
    path: "/grabConfig",
    name: "grabConfig",
    component: () => import("@/views/grabConfig/index.vue"),
    meta: { title: '抓取配置' }
  },
  {
    path: "/goodsQuery",
    name: "goodsQuery",
    component: () => import("@/views/goodsQuery/index.vue"),
    meta: { title: '商品查询' }
  },
]

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      name: '/',
      redirect: "/createTask",
      component: Layout,
      children: routes,
    },
  ]
})

export default router
